<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="templates/common.xhtml">

	<ui:define name="title">
		<h:outputText value="My Account Home" />
	</ui:define>

	<ui:define name="head">
		<script type="text/javascript">
			$(document).ready(function() {
				var colWidth = 152;

				$('#previous-column').hide();

				$('#next-column').click(function(event) {
					event.preventDefault();

					$t = $('.table-container');
					$t.animate({
						scrollLeft : '+=' + colWidth
					}, 'slow');

					if ($t.scrollLeft() + colWidth * 2 >= $t.width())
						$(this).hide();
					else {
						$('#previous-column').show();
						$(this).show();
					}
				});

				$('#previous-column').click(function(event) {
					event.preventDefault();

					$t = $('.table-container');
					$t.animate({
						scrollLeft : '-=' + colWidth
					}, 'slow');

					if ($t.scrollLeft() == colWidth)
						$(this).hide();
					else {
						$(this).show();
						$('#next-column').show();
					}
				});
			});
		</script>
		<style type="text/css">
.userItem {
	width: 200px;
	height: 200px;
	text-align: center;
}

.carouselAdvanced .userItem {
	width: 250px;
	height: 195px;
}

.value {
	font-weight: bold;
}

.ui-carousel {
	display: block;
	margin-bottom: 20px;
}

.ui-carousel .ui-carousel-header .ui-carousel-header-title {
	display: inline-block;
	overflow: hidden;
	padding-top: 2px;
	width: 60%;
}

.table-container {
	position: relative;
	width: 456px; /* Total width of visible columns + border widths */
	height: 300px;
	border: solid 1px #000;
	background-color: #eee;
	overflow: hidden;
}

.container {
	position: relative;
}

.sliding-window {
	width: 760px;
	/* Total width of all columns in sliding-window + border widths */
	height: 300px;
	overflow: hidden;
}

.sliding-window div {
	float: left;
	width: 150px;
	height: 300px;
	background-color: #aaa;
	border: solid 1px #999;
}

.imgA1 {
	position: absolute;
	top: 0px;
	left: 304px;
	z-index: 1;
	background-color: gray;
	width: 152px;
	height: 300px;
	opacity: 0;
	top: 0px;
	left: 304px;
	z-index: 1;
	background-color: gray;
	width: 152px;
	height: 300px;
	opacity: 0;
}

.imgA1:hover {
	position: absolute;
	top: 0px;
	left: 304px;
	z-index: 1;
	background-color: gray;
	width: 152px;
	height: 300px;
	opacity: 0.7;
}

.imgA2 {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 1;
	background-color: gray;
	width: 152px;
	height: 300px;
	opacity: 0;
}

.imgA2:hover {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 1;
	background-color: gray;
	width: 152px;
	height: 300px;
	opacity: 0.7;
}
</style>

	</ui:define>

	<ui:define name="header">
		<h:outputText value="My Account Home" />
		<script type="text/javaScript">
			$(document).ready(function() {
				document.getElementById('growlMessages').display == 'block';

			});
		</script>
	</ui:define>

	<ui:define name="content">
		<h:form>
			<p>Welcome, #{loginBean.uname}</p>
			<p:commandButton action="#{loginBean.logout}" value="Logout"
				ajax="false"></p:commandButton>
		</h:form>
		<p:carousel value="#{loginService.user}" headerText="User Detail:"
			var="user" numVisible="1" easing="easeOutBounce">
			<p:panelGrid columns="2" style="width:100%"
				columnClasses="label,value">

				<h:outputText value="First Name" />
				<h:outputText value="#{user.firstName}" />

				<h:outputText value="Last Name" />
				<h:outputText value="#{user.lastName}" />

				<h:outputText value="City" />
				<h:outputText value="#{user.city}" />

				<h:outputText value="State" />
				<h:outputText value="#{user.state}" />

				<h:outputText value="Country" />
				<h:outputText value="#{user.country}" />

			</p:panelGrid>
		</p:carousel>
		<p:carousel value="#{loginService.userList}"
			headerText="Friends List:" var="user" numVisible="3"
			itemStyleClass="userItem" styleClass="carouselAdvanced"
			easing="easeOutBounce">
			<p:panelGrid columns="2" style="width:100%"
				columnClasses="label,value">

				<h:outputText value="Username:" />
				<h:outputText value="#{user.userName}" />

				<h:outputText value="First Name" />
				<h:outputText value="#{user.firstName}" />

				<h:outputText value="Last Name" />
				<h:outputText value="#{user.lastName}" />

				<h:outputText value="City" />
				<h:outputText value="#{user.city}" />

				<h:outputText value="State" />
				<h:outputText value="#{user.state}" />

				<h:outputText value="Country" />
				<h:outputText value="#{user.country}" />

			</p:panelGrid>
		</p:carousel>

		<div class="container">
			<div id="previous-column" class="imgA2">
				<a href="#">Previous</a>
			</div>
			<div id="next-column" class="imgA1">
				<a href="#" style="margin-left: 2cm; margin-top: 2cm;">Next</a>
			</div>
			<div class="table-container">
				<div class="sliding-window">
					<div id="col-1">
						<p>This is the content of the first column in the sliding
							table</p>
					</div>
					<div id="col-2">
						<p>This is the content of the second column in the sliding
							table</p>
					</div>
					<div id="col-3">
						<p>This is the content of the third column in the sliding
							table</p>
					</div>
					<div id="col-4">
						<p>This is the content of the fourth column in the sliding
							table</p>
					</div>
					<div id="col-5">
						<p>This is the content of the fifth column in the sliding
							table</p>
					</div>
				</div>
			</div>
		</div>

		<p:dataTable id="table" var="car" value="#{dtBasicView.cars}">
			<p:column headerText="Id">
				<h:outputText value="#{car.id}" />
			</p:column>

			<p:column headerText="Year">
				<h:outputText value="#{car.year}" />
			</p:column>

			<p:column headerText="Brand">
				<h:outputText value="#{car.brand}" />
			</p:column>

			<p:column exportable="false" rendered="#{dtBasicView.renderColorColumn}" headerText="Color">
				<h:outputText value="#{car.color}" />
			</p:column>
		</p:dataTable>
		<p:commandButton value="Show book" update="table">
			<f:setPropertyActionListener value="true"
				target="#{dtBasicView.renderColorColumn}" />
		</p:commandButton>


	</ui:define>

</ui:composition>
